package cn.iocoder.yudao.module.system.dal.mysql.casedata;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.casedata.vo.CasePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.casedata.CaseDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 案件 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CaseMapper extends BaseMapperX<CaseDO> {

    default PageResult<CaseDO> selectPage(CasePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CaseDO>()
                .likeIfPresent(CaseDO::getCaseName, reqVO.getCaseName())
                .eqIfPresent(CaseDO::getReviewerBy, reqVO.getReviewerBy())
                .betweenIfPresent(CaseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CaseDO::getId));
    }

}